import fetch from "common/src/utils/fetch";

/**
 *  考试查询（学生）列表
 */
function getStudentListPage(data) {
  return fetch({
    url: "/api/electionservice/common/fxExamQuery/getStudentListPage",
    method: "post",
    data
  });
}

/**
 *  申请缓考
 */
function delayedExamApply(data) {
  return fetch({
    url: "/api/electionservice/fxExamApply/delayedExamApply",
    method: "post",
    data
  });
}

/**
 *  申请缓考校验
 */
function delayedExamApplyCheck(data) {
  return fetch({
    url: "/api/electionservice/fxExamApply/delayedExamApplyCheck",
    method: "post",
    data
  });
}

/**
 *  撤回申请
 */
function revokeDelayedExamApply(data) {
  return fetch({
    url: "/api/electionservice/fxExamApply/revokeDelayedExamApply/"+data,
    method: "get"
  });
}

/**
 *  考试查询（老师）列表--我的课程
 */
function getTeacherListPage(data) {
  return fetch({
    url: "/api/electionservice/common/fxExamQuery/getTeacherListPage",
    method: "post",
    data
  });
}

/**
 *  考试查询（老师）列表--我的监考--录入缺考
 */
function entryInvigilator(data) {
  return fetch({
    url: "/api/electionservice/common/fxExamQuery/entryInvigilator",
    method: "post",
    data
  });
}

/**
 *  考试查询（老师）列表--我的监考-课程查询
 */
function getTeacherInvigilateListPage(data) {
  return fetch({
    url: "/api/electionservice/common/fxExamQuery/getTeacherInvigilateListPage",
    method: "post",
    data
  });
}

/**
 *  考试查询（老师）列表--我的监考-设置座次表
 */
function setStudentSignInForm(data) {
  return fetch({
    url: "/api/electionservice/common/fxExamQuery/setStudentSignInForm",
    method: "post",
    data
  });
}

/**
 *  考试查询（老师）列表--我的监考-座次表导出PDF
 */
function exportStudentSignInFormPDF(data) {
  return fetch({
    url: "/api/electionservice/common/fxExamQuery/exportStudentSignInFormPDF",
    method: "post",
    data
  });
}

/**
 *  考试查询（老师）列表--我的课程-学生列表
 */
function getTeacherQueryStudentListPage(data) {
  return fetch({
    url: "/api/electionservice/common/fxExamQuery/getTeacherQueryStudentListPage",
    method: "post",
    data
  });
}

/**
 *  考试查询（老师）列表--我的课程/我的监考学生签到表
 * queryType    0：我的课程学生签到表（考场中我的教学班的考生），1：我的监考学生签到表（考场中所有的考生）

 */
function getTeacherQueryStudentSignInForm(data) {
  return fetch({
    url: "/api/electionservice/common/fxExamQuery/getTeacherQueryStudentSignInForm",
    method: "post",
    data
  });
}

/**
 *  考试查询（老师）列表--我的监考-查询座次表
 */
function getStudentSignInForm(data) {
  return fetch({
    url: "/api/electionservice/common/fxExamQuery/getStudentSignInForm",
    method: "post",
    data
  });
}

/**
 *  考试查询（老师）列表--我的课程--学生列表--设置考试情况
 */
function setExamSituation (data,examSituation) {
  return fetch({
    url: "/api/electionservice/fxExamStudentManagement/setExamSituation?examSituation="+examSituation,
    method: "post",
    data
  });
}

/**
 * 教师考试查询-我的监考-课程查询（导出）
 */
export function exportTeacherInvigilateList(data) {
  return fetch({
    url: '/api/electionservice/common/fxExamQuery/exportTeacherInvigilateList',
    method: 'post',
    data
  })
}

/**
 *  教师考试查询-我的课程-课程查询（导出）
 */
export function exportTeacherList(data) {
  return fetch({
    url: '/api/electionservice/common/fxExamQuery/exportTeacherList',
    method: 'post',
    data
  })
}

/**
 *  教师考试查询-我的课程-课程查询（导出）
 */
export function exportAcdemicDeanList(data) {
  return fetch({
    url: '/api/electionservice/common/fxExamQuery/exportAcdemicDeanList',
    method: 'post',
    data
  })
}

/**
 * 教师考试查询-我的课程/我的监考学生签到表（导出excel）
 * queryType    0：我的课程学生签到表（考场中我的教学班的考生），1：我的监考学生签到表（考场中所有的考生）
 */
export function exportTeacherQueryStudentSignInForm(data) {
  return fetch({
    url: '/api/electionservice/common/fxExamQuery/exportTeacherQueryStudentSignInForm',
    method: 'post',
    data
  })
}

/**
 * 教师考试查询-我的课程/我的监考学生签到表（导出pdf）
 * queryType    0：我的课程学生签到表（考场中我的教学班的考生），1：我的监考学生签到表（考场中所有的考生）
 */
export function exportTeacherQueryStudentSignInFormPDF(data) {
  return fetch({
    url: '/api/electionservice/common/fxExamQuery/exportTeacherQueryStudentSignInFormPDF',
    method: 'post',
    data
  })
}

/**
 *根据产生的重缓考、大补考查询详细学生名单
 */
export function getReExamStudentList(data) {
  return fetch({
    url: '/api/electionservice/common/fxReexamArrange/getReExamStudentList',
    method: 'post',
    data
  })
}

/**
 *查申请、已排考学生名单
 */
export function getReExamApplyStudentList(data) {
  return fetch({
    url: '/api/electionservice/common/fxReexamArrange/getReExamApplyStudentList',
    method: 'post',
    data
  })
}

/**
 *导出接口学生名单
 */
export function exportReExamApplyStudentList(data) {
  return fetch({
    url: '/api/electionservice/common/fxReexamArrange/exportReExamApplyStudentList',
    method: 'post',
    data
  })
}

/**
 *根据产生的重缓考、大补考查询详细学生名单（导出excel）
 */
export function exportReExamStudentList(data) {
  return fetch({
    url: '/api/electionservice/common/fxReexamArrange/exportReExamStudentList',
    method: 'post',
    data
  })
}

/**
 * 获取key
 */
function exportStatus(key) {
  return fetch({
    url: '/api/electionservice/undergraduateExamDownload/result/' + key,
    method: 'get'
  });
}

/**
 * 获取key
 */
function exportStatusForBlank(key) {
  return fetch({
    url: '/api/electionservice/undergraduateExamDownload/resultObs/' + key,
    method: 'get'
  });
}


export default {
  getStudentListPage : getStudentListPage,
  getTeacherListPage : getTeacherListPage,
  getTeacherInvigilateListPage : getTeacherInvigilateListPage,
  setStudentSignInForm : setStudentSignInForm,
  getTeacherQueryStudentListPage : getTeacherQueryStudentListPage,
  getTeacherQueryStudentSignInForm : getTeacherQueryStudentSignInForm,
  getStudentSignInForm : getStudentSignInForm,
  setExamSituation : setExamSituation,
  entryInvigilator : entryInvigilator,
  exportStatus : exportStatus,
  exportStatusForBlank : exportStatusForBlank,
  exportTeacherInvigilateList : exportTeacherInvigilateList,
  exportTeacherList : exportTeacherList,
  exportAcdemicDeanList : exportAcdemicDeanList,
  exportTeacherQueryStudentSignInForm : exportTeacherQueryStudentSignInForm,
  delayedExamApply : delayedExamApply,
  delayedExamApplyCheck : delayedExamApplyCheck,
  revokeDelayedExamApply : revokeDelayedExamApply,
  exportTeacherQueryStudentSignInFormPDF: exportTeacherQueryStudentSignInFormPDF,
  exportStudentSignInFormPDF : exportStudentSignInFormPDF,
  getReExamStudentList : getReExamStudentList,
  exportReExamStudentList : exportReExamStudentList,
  getReExamApplyStudentList :getReExamApplyStudentList,
  exportReExamApplyStudentList : exportReExamApplyStudentList
};
